package com.example.ssm.bean;

import javax.validation.constraints.Pattern;

public class Employee {
    private Integer empId;


    @Pattern(regexp = "(^[a-zA-Z][a-zA-Z0-9_]{4,15}$)|(^[\\u4e00-\\u9fa5]{2,}[a-zA-Z0-9_]{0,10}$)",message = "用户名不能以数字开头、不能为空且长度为6~20位或者2~6位中文！")
    private String empName;

    private String empGender;

    @Pattern(regexp = "^(13[0-9]|14[5|7]|15[0-9]|18[0-9])\\d{8}$",message = "请输入正确格式的电话号码！")
    private String empPhone;

    private Integer depId;

    private Department department;

    public Employee() {
    }

    public Employee(String empName, String empGender, String empPhone, Integer depId) {
        this.empName = empName;
        this.empGender = empGender;
        this.empPhone = empPhone;
        this.depId = depId;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public Integer getEmpId() {
        return empId;
    }

    public void setEmpId(Integer empId) {
        this.empId = empId;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName == null ? null : empName.trim();
    }

    public String getEmpGender() {
        return empGender;
    }

    public void setEmpGender(String empGender) {
        this.empGender = empGender == null ? null : empGender.trim();
    }

    public String getEmpPhone() {
        return empPhone;
    }

    public void setEmpPhone(String empPhone) {
        this.empPhone = empPhone == null ? null : empPhone.trim();
    }

    public Integer getDepId() {
        return depId;
    }

    public void setDepId(Integer depId) {
        this.depId = depId;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "empId=" + empId +
                ", empName='" + empName + '\'' +
                ", empGender='" + empGender + '\'' +
                ", empPhone='" + empPhone + '\'' +
                ", depId=" + depId +
                ", department=" + department +
                '}';
    }
}